#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QtCore/QVariant>
#include <QtWidgets/QApplication>
#include <QtWidgets/QGridLayout>
#include <QtWidgets/QGroupBox>
#include <QtWidgets/QLabel>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QMainWindow>
#include <QtWidgets/QPlainTextEdit>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QStatusBar>
#include <QtWidgets/QWidget>
#include <hardwarecheckdialog.h>
#include <QMouseEvent>

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

public:
    QWidget *centralwidget;
    QGroupBox *groupBox_last;
    QGridLayout *gridLayout_7;
    QPushButton *pBtn_export;
    QPushButton *pBtn_shutdown;
    QPlainTextEdit *pTextEdit_log;
    QWidget *widget;
    QGridLayout *gridLayout;
    QLabel *label_preson;
    QLineEdit *lineEdit_preson;
    QLabel *label_sn;
    QLineEdit *lineEdit_sn;
    QWidget *widget1;
    QGridLayout *gridLayout_cpu;
    QGroupBox *groupBox_cputmp;
    QGridLayout *gridLayout_8;
    QLabel *label_cputmp;
    QGroupBox *groupBox_cpuused;
    QGridLayout *gridLayout_6;
    QLabel *label_cpuused;
    QWidget *widget2;
    QGridLayout *gridLayout_testitem;
    QGroupBox *groupBox_perf;
    QGridLayout *gridLayout_3;
    QPushButton *pBtn_cpugpu;
    QGroupBox *groupBox_base;
    QGridLayout *gridLayout_5;
    QPushButton *pBtn_OSactive;
    QPushButton *pBtn_hardware_check;
    QPushButton *pBtn_net;
    QGroupBox *groupBox_media;
    QGridLayout *gridLayout_4;
    QPushButton *pBtn_audio;
    QPushButton *pBtn_record;
    QGroupBox *groupBox_hardware;
    QGridLayout *gridLayout_2;
    QPushButton *pBtn_usb;
    QPushButton *pBtn_camera;
    QPushButton *pBtn_disk;
    QPushButton *pBtn_dvd;
    QStatusBar *statusbar;

public:
    HardwareCheckDialog *hardwareCheckDialog;

private:

    QString greenBtnStyle = QString("QPushButton { background-color: #00FF00; }");
    QString redBtnStyle = QString("QPushButton { background-color: #FF0000; }");
    QString greyBtnStyle = QString("QPushButton { background-color: #808080; }");

private:
    void setupUi();
    void retranslateUi();
    //初始化按钮信号连接
    void btnConnect();
    void setBtnColorByRes(QPushButton *pBtn,bool res);
    //实现按钮槽功能
    void onHardwareCheckClicked();
    void onOSActiveClicked();
    void onNetCheckClicked();
    void onUSBCheckClicked();
    void onCameraCheckClicked();
    void onDiskCheckClicked();
    void onDVDCheckClicked();
    void onAudioCheckClicked();
    void onRecordCheckClicked();
    void onCPUGPUCheckClicked();
    void onExportClicked();
    void onShutdownClicked();

};
#endif // MAINWINDOW_H
